package com.x.erp.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.x.erp.dao.MultilevelActivityRewardDao;
import com.x.erp.model.MultilevelActivityReward;
import com.x.erp.rpc.MultilevelActivityRewardRpcService;
import com.x.framework.exception.BusinessException;
import com.x.framework.exception.ExceptionCode;
import com.x.framework.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 多级营销奖励级别服务
 */
@Component
@Service(interfaceName = "com.x.erp.rpc.MultilevelActivityRewardRpcService", timeout = 60000)
public class MultilevelActivityRewardService extends BaseService implements MultilevelActivityRewardRpcService {

	@Autowired
	private MultilevelActivityRewardDao multilevelActivityRewardDao;//多级营销奖励级别信息DAO

	/**
	 * 查询多级营销奖励级别列表
	 * @param multilevelActivityReward
	 * @return
	 */
	@Override
	public List<MultilevelActivityReward> selectMultilevelActivityRewardList(MultilevelActivityReward multilevelActivityReward){
		try {
			return multilevelActivityRewardDao.selectMultilevelActivityRewardList(multilevelActivityReward);
		} catch (Exception e) {
			throw new BusinessException(ExceptionCode.EXCEPTION_CODE0000, e);
		}
	}
}
